﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WithoutPermBasic.Master" AutoEventWireup="true" CodeBehind="StorageOut.aspx.cs" Inherits="StorageManage.UI.StorageOut" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        input.{width:120px;}
    </style>
    <script type="text/javascript">
        $(function () {
            var height = $("#divTotal").height();
            var master = $("#master").height();
            var content = parseFloat(height) - parseFloat(master) - 30;
            $("#tbList").css("height", content);

            $(document).keydown(function (event) {
                if (event.keyCode == 13) {
                    funcSearch();
                }
            });

            $('#tbList').datagrid({
                url: '/Logic/StorageOut.aspx?method=GetStorageOutList',
                loadMsg: '数据加载中请稍后......',
                pagination: true,
                rownumbers: true,
                singleSelect: false,
                footPager: true,
                pageSize: 100,
                queryParams: com.serializeSearchArray("form1"),
                pageList: [20, 50, 100],
                columns: [[
                     { field: 'ck', checkbox: true, width: 30 },
                     { field: 'OutCode', title: '领料单号', width: 100, align: "center", },
                     { field: 'OutTeam', title: '领料班组', width: 100, align: "center", },
                     { field: 'TaskCode', title: '生产制号', width: 100, align: "center", },
                     { field: 'ProjName', title: '项目', width: 100, align: "center", },
                     { field: 'EngName', title: '工程', width: 100, align: "center", },
                     { field: 'HmCode', title: '助记码', width: 100, align: "center", },
                     { field: 'MaterialCode', title: '物料编码', width: 100, align: "center", },
                     { field: 'Name', title: '物料名称', width: 100, align: "center", },
                     { field: 'Guige', title: '规格', width: 100, align: "center", },
                     { field: 'Caizhi', title: '材质', width: 100, align: "center", },
                     { field: 'PurcUnit', title: '单位', width: 30, align: "center", },
                     { field: 'OutZhangNum', title: '出库张数', width: 60, align: "center", },
                     { field: 'OutTotalWeight', title: '出库重量', width: 100, align: "center", },
                     
                     {
                         field: 'MaterialType', title: '物料类型', width: 80, align: "center"
                         
                     },
                     { field: 'OutPerson', title: '领料人', width: 60, align: "center", },
                     { field: 'ApplyPerson', title: '制单人', width: 60, align: "center", },
                     { field: 'ApplyTime', title: '制单时间', width: 130, align: "center", },
                ]],
                onDblClickRow: function (rowIndex, rowData) {
                    top.wrapper.addTab('余料出库单', '/UI/ViewStorageOutDetail.aspx?outCode=' + rowData.OutCode);
                }
            });
        });
    </script>

    <script type="text/javascript">
        function funcSearch() {
            var para = com.serializeSearchArray('form1');
            $('#tbList').datagrid('load', para);
        }
        function funcSelect() {
            $('#divSearchShow').toggle();
        }
        function funcReload() {
            $('#form1').form('clear');
        }     
        function funcEdit() {
            var row = $('#tbList').datagrid('getSelected');
            
            if (row) {
                top.wrapper.addTab('余料出库单', '/UI/StorageOutDetail.aspx?action=edit&outCode=' + row.OutCode);
            } else {
                com.message('information', '请选中一行');
            }
            
        }
        function funcRemove() {
            var row = $('#tbList').datagrid('getSelected');
            if (row) {
                $.messager.confirm('确认框', '您确认要删除此单吗', function (r) {
                    if (r) {
                        com.ajax({
                            url: '/Logic/StorageOut.aspx?method=DeteleStorageOut&id=' + row.MainId,
                            success: function (data) {
                                if (data.state == "success") {
                                    com.message('information', '删单成功');
                                    $('#tbList').datagrid('reload');
                                } 
                            }
                        });
                    }
                });


            } else {
                com.message('information', '请选中一行')
            }
        }
        function funcExportExcel() {
            var para = com.serializeSearchArray1('form1');
            top.wrapper.addTab('导出', '/ExportModel/ExportStorageOut.aspx?searchData=' + para);
        }
        function funcGo() {
            top.wrapper.addTab('库存查询', '/UI/Storage.aspx');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceToorbar" runat="server">
      <a href="javascript:void(0)" id="btnSearch" class="easyui-linkbutton" onclick="funcSearch()"
        data-options="iconCls:'icon-search'">查询</a>
    <a href="javascript:void(0)" id="btnSelect" class="easyui-linkbutton" onclick="funcSelect()" data-options="iconCls:'icon-zoom'">筛选</a>
    <a href="javascript:void(0)" id="btnReload" class="easyui-linkbutton" onclick="funcReload()"
        data-options="iconCls:'icon-reload'">重置</a>
    <a href="javascript:void(0)" id="btnGo" class="easyui-linkbutton" onclick="funcGo()"
        data-options="iconCls:'icon-application_go'">到库存</a>
    <a href="javascript:void(0)" id="btnEdit" class="easyui-linkbutton" onclick="funcEdit()"
        data-options="iconCls:'icon-edit'">修改记录</a>
    
    <a href="javascript:void(0)" id="btnRemove" class="easyui-linkbutton" onclick="funcRemove()"
        data-options="iconCls:'icon-remove'">删除记录</a>
    <a href="javascript:void(0)" id="btnExportExcel" class="easyui-linkbutton" onclick="funcExportExcel()"
        data-options="iconCls:'icon-ext-xls'">导出Excel</a>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
     <div id="master" class="container_16" style="height: auto; float: left;"">
        <form id="form1">
             <div class="grid_2 sealbl" style="text-align: right;">
                领料班组:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <%--  <input type="text" id="MakingNum" name="MakingNum" data-cp="co" />--%>
               <input id="OutTeam" name="OutTeam" class="easyui-combobox" data-options="valueField:'text',textField:'text',url:'/Logic/StorageIn.aspx?method=GetTeam',panelHeight:'200',mode:'remote'," data-cp="co" />
            </div>
             <div class="grid_2 sealbl" style="text-align: right;">
                生产制号:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="TaskCode" name="TaskCode" data-cp="co" class="easyui-combobox" data-options="valueField:'value', textField:'text',url:'/Logic/StorageIn.aspx?method=GetTaskCode',mode:'remote',panelHeight:'200'" />
            </div>
             <div class="grid_2 sealbl" style="text-align: right;">
                助记码:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="HmCode" name="HmCode" data-cp="co" class="easyui-combobox" data-options="valueField:'value', textField:'text',url:'/Logic/StorageIn.aspx?method=GetHmCode',mode:'remote',panelHeight:'200'" />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                领料单号:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="OutCode" name="OutCode" data-cp="co" />
            </div>
            <div class="Clear"></div>
            <div id="divSearchShow" hidden="hidden">
                  <div class="grid_2 sealbl" style="text-align: right;">
                制单人:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="ApplyName" name="ApplyName" data-cp="co" />
            </div>
             <div class="grid_2 sealbl" style="text-align: right;">
                制单日从:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="StartTime" name="StartTime" data-cp="str>=" class="easyui-datebox" />
            </div>
             <div class="grid_2 sealbl" style="text-align: right;">
                制单日到:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="EndTime" name="EndTime" data-cp="str<=" class="easyui-datebox" />
            </div>

            </div>
          
        </form>
    </div>
    <table id="tbList" title="余料领料单" style="width: 100%">
        </table>

</asp:Content>
